from django import forms


class AddStockForms(forms.Form):
    stock_address_id = forms.IntegerField(required=True)
    stock_code = forms.CharField(required=True, min_length=1, error_messages={'required': u'内容不能为空'})


class DeleteStockForms(forms.Form):
    stock_address_id = forms.IntegerField(required=True)
    stock_code = forms.CharField(required=True, min_length=1)


class OrderStockForms(forms.Form):
    stock_address_id = forms.IntegerField(required=True)  # 交易所ID
    stock_code = forms.CharField(required=True, min_length=1)  # 股票代码
    number = forms.IntegerField(required=True)  # 股票委托数量
    price = forms.FloatField(required=True)  # 委托价格


class OrderCancelForms(forms.Form):
    order_id = forms.UUIDField(required=False)
    action = forms.CharField(required=True)

class OpenInterestEditForms(forms.Form):
    open_interest_id = forms.IntegerField(required=True)
    price = forms.FloatField(required=True)
